<?php

namespace common\repositories\common;

use common\repositories\BaseRepository;
use Yii;
use common\entities\common\MyscrmOrganizationToAuthorizeEntity;

class OrganizationToAuthorizeRepository extends BaseRepository {

   /**
    * 根据租户id,获取租户下某个合同的授权信息列表
    * @param string $organizationId 租户id
    * @param string $contractId 合同id
    * @return array
    */
	public static function getAuthorizeListByOrganizationId($organizationId,$contractId) {
		return MyscrmOrganizationToAuthorizeEntity::getAuthorizeListByOrganizationId($organizationId,$contractId);
	}


    /**
     * 根据基本信息产品id,获取授权信息中所有的授权
     * @param string $organizationId 租户id
     * @param string $ContractApplicationId 合同产品id
     * @return int
     */
    public static function getAuthorizeNumByContractApplicationId($contractapplicationId) {
        return MyscrmOrganizationToAuthorizeEntity::getAuthorizeNumByContractApplicationId($contractapplicationId);
    }

    /**
     * 增加合同的产品授权
     * @param string $organizationId 租户id
     * @param array
     * @return boolean
     */
    public static function addAuthorizeByOrganizationId($arr) {
        return MyscrmOrganizationToAuthorizeEntity::addAuthorizeByOrganizationId($arr);
    }


    public static function getContractOrderSummary($contractNum) {
        return MyscrmOrganizationToAuthorizeEntity::getContractOrderSummary($contractNum);
    }



}
